<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
<div id="test">123</div>

<div id="test2">
	<div data-value="zhangwei">234</div>
	<div data-value="zhangwei2">234</div>
</div>
<script>
	$("#test").attr('data-value','hongwei');
	
	var b = $('#test2').data('value');
	console.log(b);
</script>
</body>
</html>